import {useState} from "react";

function useCounter(initiaValue = 0) {
    const [count, setCount] = useState(initiaValue);
    const increment = () => setCount(count + 1)
    const decrement = () => setCount(count - 1)

    return {count, increment, decrement};
}

export default useCounter;